<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class User extends Model
{
    // 用户
    protected $table = "user";
    public $timestamps = false;
    protected $guarded = ['id'];

    public function craftsman()
    {
        return $this->hasOne('App\Craftsman');
    }

    public function note()
    {
        return $this->hasMany('App\Note');
    }

    public function note_comment()
    {
        return $this->hasMany('App\Note_Comment');
    }

    public function note_like()
    {
        return $this->hasMany('App\Note_Like');
    }

    public function fan()
    {
        return $this->hasMany('App\Fan');
    }

    public function follow()
    {
        return $this->hasMany('App\Fan', 'fan_id');
    }

    public function goods()
    {
        return $this->hasMany('App\Goods','craftsman_id','craftsman_id');
    }

    public function blog()
    {
        return $this->hasMany('App\Blog','craftsman_id','craftsman_id');
    }
}
